package com.chapter10.interface_.case_;

public class Test {
    public static void main(String[] args) {
        //创建设备对象
        Camera camera1 = new Camera();
        camera1.setName("Camera 1");
        Camera camera2 = new Camera();
        camera2.setName("Camera 2");
        Computer computer = new Computer();

        computer.work(camera1);

        //USB接口中存放Camera和Phone对象，Phone类还有个特殊的方法call()
        USB[] usb = new USB[2];
        usb[0] = camera1;
        usb[1] = camera2;
        for (int i = 0; i < usb.length; i++) {
            System.out.println(usb[i].toString());
        }

    }
}